<?php
defined('BASEPATH') OR exit('No direct script access allowed');
	class order_model extends CI_Model{
        public $table_name='orders';
   	    public function add_one_order($user_id,$address_id){
            //var_dump($address_id);
          $this->db->insert($this->table_name,array(
            'user_id'=>$user_id,
            'address_id'=>$address_id,
            'create_time'=>time()
        ));
          return $this->db->insert_id();
        }
        public function add_products_to_order($order_id,$product_id,$num){
            $this->db->insert('order_products',array(
            'order_id'=>$order_id,
            'product_id'=>$product_id,
            'num'=>$num
        ));
        }
     

	}